package se.sics.drsm.util;

import java.io.IOException;

import se.sics.kompics.p2p.bootstrap.BootstrapConfiguration;

public class Configurations {

    private static Configurations configuration = new Configurations();
    private static BootstrapConfiguration bootstrapConfiguration;


    private Configurations() {

    }

    public Configurations getInstance() {
        return configuration;
    }

    public void loadConfigs() {

        loadBootstrapConfig();
    }

    private void loadBootstrapConfig() {
        try {
            bootstrapConfiguration = BootstrapConfiguration.load("bootstrap.properties");
        } catch (IOException e) {
            bootstrapConfiguration = getDefaultBootstrapConfig();
            e.printStackTrace();
            //log a warning also
        }
    }

    private BootstrapConfiguration getDefaultBootstrapConfig() {
        return new BootstrapConfiguration(null, 0, 2000, 20, 2000, 54667, 8080);
    }

}
